package chapter02

import scala.collection.mutable

object Test23_Set {
  def main(args: Array[String]): Unit = {
    //定义一个set 不可变的set
    var set = Set(1, 2, 3, 4, 5, 6)
    println(System.identityHashCode(set))
    set.+=(10)
    println(System.identityHashCode(set))
    for(i<-set){println(i)}
    //可变的set
    val set1 = mutable.Set(1, 2, 3, 4, 5)
    println(System.identityHashCode(set1))
    set1.add(10)
    println(set1.toList.sorted)
    println(System.identityHashCode(set1))
  }
}
